﻿// -----------------------------------------------------------------------
// <copyright file="DataExtensionManagerPlugin.cs" company="DotSpatial Team">
//   (c) 2011; Released under Microsoft Public License (Ms-PL)
// </copyright>
// -----------------------------------------------------------------------
using DotSpatial.Data;

namespace DotSpatial.Plugins.ExtensionManager
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using DotSpatial.Controls;
    using DotSpatial.Controls.Header;

    /// <summary>
    /// 
    /// </summary>
    public class DataExtensionManagerPlugin : Extension
    {

        public override void Activate()
        {
            App.HeaderControl.Add(new SimpleActionItem("Data Extension Manager", ButtonClick));
            base.Activate();
        }

        public override void Deactivate()
        {
            App.HeaderControl.RemoveAll();
            base.Deactivate();
        }

        public void ButtonClick(object sender, EventArgs e)
        {
            DataExtensionForm form = new DataExtensionForm();
            form.InitGrid(DataManager.DefaultDataManager.PreferredProviders, DataManager.DefaultDataManager.DataProviders);
            form.Show();
        }

    }
}
